//
// CHeightMap.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

public class CHeightMap {
  private long swigCPtr;
  protected boolean swigCMemOwn;

  public CHeightMap(long cPtr, boolean cMemoryOwn) {
    swigCMemOwn = cMemoryOwn;
    swigCPtr = cPtr;
  }

  public static long getCPtr(CHeightMap obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CHeightMap(swigCPtr);
      }
      swigCPtr = 0;
    }
  }

  public void setHeights(SWIGTYPE_p_std__vectorT_unsigned_char_t value) {
    nel3dJNI.CHeightMap_Heights_set(swigCPtr, this, SWIGTYPE_p_std__vectorT_unsigned_char_t.getCPtr(value));
  }

  public SWIGTYPE_p_std__vectorT_unsigned_char_t getHeights() {
    long cPtr = nel3dJNI.CHeightMap_Heights_get(swigCPtr, this);
    return (cPtr == 0) ? null : new SWIGTYPE_p_std__vectorT_unsigned_char_t(cPtr, false);
  }

  public void setOriginX(float value) {
    nel3dJNI.CHeightMap_OriginX_set(swigCPtr, this, value);
  }

  public float getOriginX() {
    return nel3dJNI.CHeightMap_OriginX_get(swigCPtr, this);
  }

  public void setOriginY(float value) {
    nel3dJNI.CHeightMap_OriginY_set(swigCPtr, this, value);
  }

  public float getOriginY() {
    return nel3dJNI.CHeightMap_OriginY_get(swigCPtr, this);
  }

  public void setSizeX(float value) {
    nel3dJNI.CHeightMap_SizeX_set(swigCPtr, this, value);
  }

  public float getSizeX() {
    return nel3dJNI.CHeightMap_SizeX_get(swigCPtr, this);
  }

  public void setSizeY(float value) {
    nel3dJNI.CHeightMap_SizeY_set(swigCPtr, this, value);
  }

  public float getSizeY() {
    return nel3dJNI.CHeightMap_SizeY_get(swigCPtr, this);
  }

  public void setMaxZ(float value) {
    nel3dJNI.CHeightMap_MaxZ_set(swigCPtr, this, value);
  }

  public float getMaxZ() {
    return nel3dJNI.CHeightMap_MaxZ_get(swigCPtr, this);
  }

  public CHeightMap() {
    this(nel3dJNI.new_CHeightMap(), true);
  }

  public void resize(long w, long h) {
    nel3dJNI.CHeightMap_resize(swigCPtr, this, w, h);
  }

  public long getWidth() {
    return nel3dJNI.CHeightMap_getWidth(swigCPtr, this);
  }

  public long getHeight() {
    return nel3dJNI.CHeightMap_getHeight(swigCPtr, this);
  }

  public float getZ(long x, long y) {
    return nel3dJNI.CHeightMap_getZ(swigCPtr, this, x, y);
  }

  public void buildFromBitmap(SWIGTYPE_p_NLMISC__CBitmap bitmap) {
    nel3dJNI.CHeightMap_buildFromBitmap(swigCPtr, this, SWIGTYPE_p_NLMISC__CBitmap.getCPtr(bitmap));
  }

}
